{extend name="layout/edit" /}
{block name="form"}
<form id="form">
	<input type="hidden" value="{$info.id}" name="id" />
	<div class="form-group">
		<label class="control-label">{$tables['fields']['username']['name']}</label>
		<input class="form-control" type="text" placeholder="" name="username" value="{$info.username}">
	</div>
	<div class="form-group">
		<label class="control-label">{$tables['fields']['password']['name']}</label>
		<input class="form-control" type="text" placeholder="" name="password" value="">
	</div>
	<div class="form-group">
		<label class="control-label">{$tables['fields']['fullname']['name']}</label>
		<input class="form-control" type="text" placeholder="" name="fullname" value="{$info.fullname}">
	</div>
	<div class="form-group">
		<label class="control-label">{$tables['fields']['phone']['name']}</label>
		<input class="form-control" type="text" placeholder="" name="phone" value="{$info.phone}">
	</div>
	<div class="form-group">
		<label class="control-label">{$tables['fields']['email']['name']}</label>
		<input class="form-control" type="text" placeholder="" name="email" value="{$info.email}">
	</div>
	<div class="form-group">
		<label class="control-label">{$tables['fields']['status']['name']}</label>
		<select class="form-control" placeholder="" name="status">
			{foreach $tables['fields']['status']['options'] as $key=>$vo } 
			<option value="{$key}" {if $key==$info->getData('status')}selected{/if}>{$vo}</option>
			{/foreach}
		</select>
	</div>
	<div class="form-group">
		<label class="control-label">所属组</label>
		{if is_array($grouplist)}
		{foreach $grouplist as $key=>$value}
		<div class="animated-checkbox">
			<label>
				<input type="checkbox" name="auth_group[]" value="{$key}" {if !empty($info.groups)}
				{foreach $info['groups'] as $k=>$v } 
				{if $v['id'] == $key}
				checked
				{/if}
				{/foreach}
				{/if} >
				<span class="label-text">{$value}</span>
			</label>
		</div>
		{/foreach}
		{/if}
	</div>
	<div class="tile-footer">
		<button class="btn btn-primary" type="button" id="submitbutton">
			<i class="fa fa-fw fa-lg fa-check-circle"></i>提交
		</button>&nbsp;&nbsp;&nbsp;
		{if checkurl($now_route['controller'].'/delete')}
		<button type="button"  class="btn btn-secondary delete" data-href="{:url('delete',array('id'=>$info['id']))}" >
			<i class="fa fa-fw fa-lg fa-times-circle"></i>删除
		</button>
		{/if}
	</div>
</form>
{/block}
